Skip to content

[rush-lib, rig-package, etc.] Dependency cleanup: remove several small third-party packages#5784

Merged
iclanton merged 15 commits intomicrosoft:mainfrom
iclanton:dependency-cleanup
Apr 18, 2026
Merged

[rush-lib, rig-package, etc.] Dependency cleanup: remove several small third-party packages#5784
iclanton merged 15 commits intomicrosoft:mainfrom
iclanton:dependency-cleanup

Conversation

@iclanton
Copy link
Copy Markdown
Member

@iclanton iclanton commented Apr 18, 2026

Summary

Remove several unnecessary third-party dependencies across the monorepo, replacing each with a native Node.js API or a utility already present in the repo.

Details

Each removal is a separate commit:

  • @ungap/structured-clone (heft-config-file) — replaced with native structuredClone (Node 18+)
  • glob-escape (rush-lib) — replaced with fast-glob's built-in escapePath (already a dependency)
  • strip-json-comments (rig-package) — replaced with jju.parse(), which node-core-library already uses for the same purpose
  • figures (rush-lib) — the single character used (figures.pointer) replaced with a named const POINTER = '\u276F'
  • open (lockfile-explorer) — replaced with Executable.spawn() from node-core-library
  • update-notifier (lockfile-explorer) — removed entirely; the update notification block was non-essential
  • builtin-modules (rush-lib) — replaced with node:module.isBuiltin() (Node 18+)
  • giturl (npm-check-fork) — replaced with a new toHttpsUrl() function using the native URL class; unit-tested
  • scheduler@0.19.0 (rush-vscode-command-webview) — explicit pin removed; 0.27.0 (already installed transitively via react-dom) satisfies the >=0.19.0 peer dep range of @fluentui/react-context-selector

All removed packages are also dropped from common/config/rush/*-approved-packages.json.

How it was tested

  • TypeScript compilation validates that all replacement APIs have the correct types
  • New unit tests added for toHttpsUrl() in npm-check-fork
  • Existing test suites cover the affected code paths

🤖 Generated with Claude Code

Comment thread DEPENDENCY_CLEANUP.md Outdated
@iclanton iclanton force-pushed the dependency-cleanup branch from ac36e95 to d467f32 Compare April 18, 2026 00:30
@iclanton iclanton enabled auto-merge (squash) April 18, 2026 01:31
iclanton and others added 15 commits April 17, 2026 19:40
Node 18+ is the minimum supported version, so the native structuredClone
is available. The TODO comment tracking this removal is also deleted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fast-glob (already a dependency) exposes escapePath, which covers the
same characters. Removed the glob-escape package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jju is already used by node-core-library for the same purpose (JSONC
parsing). Using jju.parse() directly eliminates the strip+parse two-step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replaced open() with Executable.spawn() from node-core-library using
  the platform-native open command (open/xdg-open/cmd start).
- Removed the update-notifier block entirely; update notifications
  are low-value and add a non-trivial dependency chain.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Node 18+ provides module.isBuiltin() natively. The builtin-modules
package was a static list that needed to track Node releases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…p doc

Removes builtin-modules, figures, glob-escape, open, strip-json-comments,
and update-notifier from nonbrowser-approved-packages.json and
@ungap/structured-clone from browser-approved-packages.json.

Also expands DEPENDENCY_CLEANUP.md to a full census of all third-party
dependencies across apps/, libraries/, heft-plugins/, rigs/, rush-plugins/,
vscode-extensions/, webpack/, and repo-scripts/.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced with a native implementation using the URL class (toHttpsUrl.ts).
Added direct unit tests for the new function.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
scheduler@0.27.0 is already installed transitively via react-dom and satisfies
the >=0.19.0 peer dependency range of @fluentui/react-context-selector; the
explicit pin was redundant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@iclanton iclanton force-pushed the dependency-cleanup branch from 31c7151 to 0e3bb9b Compare April 18, 2026 02:45
@iclanton iclanton merged commit 4cdcc32 into microsoft:main Apr 18, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage Apr 18, 2026
@iclanton iclanton deleted the dependency-cleanup branch April 18, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants